package com.jd.feign;

import com.jd.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient(name = "user-service",fallbackFactory = UserFeignClientFallbackFactory.class)  // 表示一个feign接口，被调用方的服务名
@RequestMapping("/user")
public interface UserService {


    // 根据id查询user对象
    @GetMapping("/getUserById/{id}")
    User getUserById(@PathVariable("id") Long id);

}
